home *** CD-ROM | disk | FTP | other *** search
- unit Additmu2;
-
- interface
-
- uses
- SysUtils;
-
- type
- EShellError = class(Exception);
-
- procedure CreateShortCut(const Folder, Description, Path, Arguments,
- Directory, IconPath: String; IconIndex: Integer; ShowMin: Boolean);
-
- implementation
-
- uses
- DdeMan;
-
- procedure CreateShortCut(const Folder, Description, Path, Arguments,
- Directory, IconPath: String; IconIndex: Integer; ShowMin: Boolean);
- var
- Cmd: array[0..255] of Char;
- begin
- with TDdeClientConv.Create(nil) do
- try
- SetLink('ProgMan', '');
- OpenLink;
- try
- StrPCopy(Cmd, Format('[CreateGroup(%s)]'#13#10, [Folder]));
- ExecuteMacro(Cmd, False);
- { AddItem(CmdLine, Description, IconFile, IconIndex, X, Y, DefDir, Hotkey, Minimize }
- StrPCopy(Cmd, Format('[AddItem(%s %s, %s, %s, %d, , , %s, , 0)]'#13#10,
- [Path, Arguments, Description, IconPath, IconIndex, Directory]));
- if not ExecuteMacro(Cmd, False) then
- raise EShellError.Create('Unable to create item.')
- finally
- CloseLink
- end
- finally
- Free
- end;
- end;
-
- end.
- object DDEClient: TDdeClientConv
- DdeService = 'ProgMan'
- LinkInfo = (
- 'Service ProgMan'
- 'Topic ')
- end
-